JavaScript

Date Class

Description

Methods to extend the native date variable.

Methods

adjust Method

Extension to the native date variable to allow for the quick adjustment of a given date.

constrain Method

Extension to the native date variable to allow the date variable to be constrained to a min and/or max.

diff Method

Extension to the native date variable to allow for checking the difference between the date variable and a specified date or the current date.

fromFormat Method

Extension to the native date variable to set the date variable to the value of the passed in date string.

fromObject Method

Extension to the native date variable to set the date variable to the value of one or more parts of an object or array.

getDayOfQuarter Method

Extension to the native date variable to the get the day of the quarter of a given date.

getDayOfYear Method

Extension to the native date variable to the get the day of the year of a given date.

getDaysInMonth Method

Extension to the native date variable to the get the number of days in the month a given date is in.

getDaysInQuarter Method

Extension to the native date variable to the get the number of days in the quarter a given date is in.

getDaysInYear Method

Extension to the native date variable to the get the total number of days in the year of a given date.

getParts Method

Extension to the native date variable to the get some or all of the parts that make up the date.

getQuarter Method

Extension to the native date variable to get the quarter a given date is in.

getQuarterRange Method

Extension to the native date variable to get the start and end of the quarter a given date is in.

getWeekOfMonth Method

Extension to the native date variable to the get the week of the month a given date is in. The first of the month will always be in the first week regardless of how many subsequent days are in the same week.

getWeekOfYear Method

Extension to the native date variable to the get the week of the year a given date is in.

getWeeksInMonth Method

Extension to the native date variable to the get the total number of weeks in the month a given date is in. The first of the month will always be in the first week regardless of how many subsequent days are in the same week.

getWeeksInYear Method

Extension to the native date variable to the get the total number of weeks in the year a given date is in.

same Method

Extension to the native date variable to allow for checking if one date is the same as another in a given time scope.

setClock Method

Extension to the native date variable to allow for the quick setting of time on a date.

toCalendar Method

Extension to the native date variable to allow the conversion of the date into a calendar date relative to the current date.

toFormat Method

Extension to the native date variable to create a formatted string.

toRelative Method

Extension to the native date variable to allow the conversion of the date into string showing the date relative to the current date.